package com.heima.feign.schedule;

import com.heima.model.common.dtos.ResponseResult;
import com.heima.model.schedule.dto.Task;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

@FeignClient("leadnews-schedule")
@RequestMapping("/api/v1/task")
public interface IScheduleClient {
    //添加任务
    @PostMapping("/add")
    ResponseResult addTask(@RequestBody Task task);

    //取消任务
    @GetMapping("/cancel/{taskId}")
    ResponseResult cancelTask(@PathVariable("taskId") long taskId);

    //消费任务
    @GetMapping("/poll")
    ResponseResult poll();
}
